<% unit.forEach(function(obj){
%>
<tr data-tt-id="<%=obj.id%>" data-tt-parent-id="<%=obj.parentId==0?'':obj.parentId%>" data-tt-branch="<%=obj.hasChildren==1?'true':'false'%>">
  <td>
    <span class="pd-l-sm"></span> <%-obj.name%>
  </td>
  <td><%if(obj.typeid){%>[<%=obj.typeid.name%>]<%}else{%>[通用商品]<%}%></td>
  <td><%if(!obj.disabled){%><i id="disable_<%=obj.id%>" class="fa fa-circle text-success ml5"></i><%}else{%><i id="disable_<%=obj.id%>" class="fa fa-circle text-danger ml5"></i><%}%></td>
  <td><%if(obj.is_index){%><i id="is_index_<%=obj.id%>" class="fa fa-circle text-success ml5"></i><%}else{%><i id="is_index_<%=obj.id%>" class="fa fa-circle text-danger ml5"></i><%}%></td>
  <td>
    <div class="btn-group">
      <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">
        <i class="ti-settings"></i>
        <span class="ti-angle-down"></span>
      </button>
      <ul class="dropdown-menu" role="menu">
        <li><a href="/private/shop/goods/class/edit/<%=obj.id%>" data-pjax>修改</a></li>
        <li><a href="javascript:;" onclick="del(<%=obj.id%>)">删除</a></li>
        <li class="divider"></li>
        <li><a href="/private/shop/goods/class/add?pid=<%=obj.id%>" data-pjax>添加子分类</a></li>
        <li class="divider"></li>
        <li><a href="javascript:;" onclick="enableRole(<%=obj.id%>)">启用</a></li>
        <li><a href="javascript:;" onclick="disableRole(<%=obj.id%>)">禁用</a></li>
      </ul>
    </div>
  </td>
</tr>
<%
}); %>
